function [JL_mean JG_mean]=lvm(filename,time)
    fprintf('     Processing %s\n',  filename);            
    comma2point_overwrite(filename); %Converte "virgulas" em "pontos" nos arquivos .LVM
    %importdata(LVM_files(i).name, '\t', 22); %Importa arquivos .LVM, separa por tab, 22 linhas de heather
    data = lvm_import(filename); %Uses lvm_import fuction to import the measured JL and JG velocities
    matrix_aux = data.Segment1.data;
    j = 1;     
    
    %Separa JL e JG
    while (matrix_aux(j,1) < (time))
    %while (matrix_aux(j,1) <= (num_seg))
        JL_med(j) = matrix_aux(j,3);
        JG_med(j) = matrix_aux(j,4);
        j = j+1;
    end        
    JL_mean = mean(JL_med);              %Faz as medias e desvios padroes e salva na matriz final    
    JG_mean = mean(JG_med);
    
end